#!/usr/bin/env bash

############################################################################
#
# 远程执行该脚本，请在命令行中直接执行以下命令：
#
#   curl -sSL https://gitee.com/tay3223/biubiubiu/raw/master/centos7-install-python375.sh | /bin/bash
#
#
############################################################################

ls /usr/local | grep python37

if [ $? -eq 0 ]; then
    echo "压缩包已经存在。。。"
else
    mkdir -p /tmp/bao/python
    wget -c -P /tmp/bao/python/ http://osoc.oss-cn-shanghai.aliyuncs.com/bao/python/python37_tianye.tar.gz
    tar zxvf /tmp/bao/python/python37_tianye.tar.gz -C /usr/local/
fi

ln -s /usr/local/python37/bin/python3 /usr/local/bin/python3
ln -s /usr/local/python37/bin/pip3 /usr/local/bin/pip3
ln -s /usr/local/python37/bin/pyvenv-3.7 /usr/local/bin/pyenv
ln -s /usr/local/python37/bin/pyvenv-3.7 /usr/local/bin/pyvenv

cat <<lalala

===================================================
python3安装成功！！！

文件解压在/usr/local/python37目录下

相关命令已经软连接到/usr/local/bin/目录下
===================================================

lalala
